package com.ruoyi.db.sms.domain;

import lombok.Data;
import lombok.EqualsAndHashCode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.ruoyi.framework.aspectj.lang.annotation.Excel;
import com.ruoyi.framework.web.domain.BaseEntity;
import javax.validation.constraints.Size;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 优惠券对象 sms_coupon
 *
 * @author yfy
 * @date 2020-04-24
 */

@ApiModel("优惠券实体类")
@Data
@EqualsAndHashCode(callSuper=true)
public class SmsCoupon extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("优惠券ID")
    @Excel(name = "优惠券ID")
    private Long id;

    @ApiModelProperty("优惠券名称")
    @Excel(name = "优惠券名称")
    @NotBlank(message = "优惠券名称不能为空")
    @Size(min = 0, max = 63, message = "优惠券名称长度不能超过63个字符")
    private String name;

    @ApiModelProperty("优惠券介绍")
    @Excel(name = "优惠券介绍")
    @Size(min = 0, max = 127, message = "优惠券介绍长度不能超过127个字符")
    private String description;

    @ApiModelProperty("优惠券标签")
    @Excel(name = "优惠券标签")
    @Size(min = 0, max = 63, message = "优惠券标签长度不能超过63个字符")
    private String tag;

    @ApiModelProperty("优惠券数量(0是无限量)")
    @Excel(name = "优惠券数量(0是无限量)")
    @NotBlank(message = "优惠券数量(0是无限量)不能为空")
    private Integer total;

    @ApiModelProperty("满减金额")
    @Excel(name = "满减金额")
    private BigDecimal discount;

    @ApiModelProperty("最少消费金额")
    @Excel(name = "最少消费金额")
    private BigDecimal minimum;

    @ApiModelProperty("用户领券限制数量（0不限制 1限领一张）")
    @Excel(name = "用户领券限制数量", readConverterExp = "0=不限制,1=限领一张")
    private Integer limitGet;

    @ApiModelProperty("优惠券赠送类型（0用户领取的通用券 1注册赠券 2优惠券码兑换）")
    @Excel(name = "优惠券赠送类型", readConverterExp = "0=用户领取的通用券,1=注册赠券,2=优惠券码兑换")
    private Integer givenType;

    @ApiModelProperty("优惠券状态（0正常可用 1过期 2下架）")
    @Excel(name = "优惠券状态", readConverterExp = "0=正常可用,1=过期,2=下架")
    private Integer status;

    @ApiModelProperty("商品限制类型（0全商品 1类目限制 2商品限制）")
    @Excel(name = "商品限制类型", readConverterExp = "0=全商品,1=类目限制,2=商品限制")
    private Integer goodsType;

    @ApiModelProperty("商品限制值（0空集合 1类目集合 2商品集合）")
    @Size(min = 0, max = 1023, message = "商品限制类型长度不能超过1023个字符")
    private String goodsValue;

    @ApiModelProperty("优惠券兑换码")
    @Size(min = 0, max = 63, message = "商品限制类型长度不能超过63个字符")
    private String code;

    @ApiModelProperty("有效时间限制（0有效天数 1start_time与end_time期间）")
    private Integer timeType;

    @ApiModelProperty("有效天数")
    private Integer days;

    @ApiModelProperty("开始时间")
    private LocalDateTime startTime;

    @ApiModelProperty("截至时间")
    private LocalDateTime endTime;

    @ApiModelProperty("创建时间")
    private LocalDateTime addTime;

    @ApiModelProperty("逻辑删除")
    private Integer deleted;
}
